package miku.firstgame.net.pack
{
	import miku.firstgame.constrants.ProtocalConstants;
	import miku.firstgame.net.ByteArrayEx;
	
	public class AddRoomResponsePack extends AbstractReponsePack
	{
		public var result:int;
		public var roomId:int;
		public var roomName:String;
		public var password:String;
		public var createUserId:int;
		
		public function AddRoomResponsePack(data:ByteArrayEx)
		{
			super(data);
		}
		
		override public function get tag():int
		{
			return ProtocalConstants.ADD_ROOM;
		}
		override public function decode():void
		{
			super.decode();
			data.position = 4;
			result = data.readUnsignedByte();
			if(result == 0)
			{	
				roomId = data.readUnsignedInt();
				roomName = data.readString();
				password = data.readString();
				createUserId = data.readUnsignedInt();
			}
			
		}
	}
}